<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Sale\LoginController;
use App\Http\Controllers\Sale\SaleApplyController;
use App\Http\Controllers\Sale\SaleUserController;
use App\Http\Controllers\Sale\OrderController;
use App\Http\Controllers\Sale\AmountController;
use App\Http\Controllers\Sale\GoodsController;
use App\Http\Controllers\Sale\WithdrawalController;
use App\Http\Controllers\Sale\AuthController;


Route::middleware('cors')->group(function () {
    Route::group([
        'prefix' => 'Sale',
    ], function () {

        Route::post('/upload', [LoginController::class, 'upload']); //文件上传接口

        Route::post('/Login',  [LoginController::class, 'login']);//登录
        Route::get('/LoginOut', [LoginController::class, 'loginOut']);//退出登陆
        Route::post('/Login/forgetPwd',  [LoginController::class, 'forgetPwd']);//忘记密码//供应商入驻

        Route::post('/Login/sendCode',  [LoginController::class, 'sendCode']);//发送验证码

        Route::post('/SaleApply/addUser', [SaleApplyController::class, 'addUser']); //注册账号/添加账号

        Route::get('/SaleUser/saleApplyList', [SaleUserController::class, 'saleApplyList']); //申请审批列表

        Route::post('/SaleUser/checkPass', [SaleUserController::class, 'checkPass']); //审批通过

        Route::post('/SaleUser/checkRefuse', [SaleUserController::class, 'checkRefuse']); //审批拒绝

        Route::post('/SaleUser/saleApplyDetail', [SaleUserController::class, 'saleApplyDetail']); //查看申请审批/成员资料/个人中心资料

        Route::post('/SaleUser/saleUserEdit', [SaleUserController::class, 'saleUserEdit']); //编辑成员资料

        Route::get('/SaleUser/saleUserList', [SaleUserController::class, 'saleUserList']); //成员管理

        Route::get('/SaleUser/saleSonList', [SaleUserController::class, 'saleSonList']); //账号管理

        Route::get('/SaleUser/saleSonAdd', [SaleUserController::class, 'saleSonAdd']); //添加子账号

        Route::get('/Order/orderList', [OrderController::class, 'orderList']); //订单列表

        Route::get('/Order/overdueOrderList', [OrderController::class, 'overdueOrderList']); //逾期订单列表

        Route::post('/Order/getRegion', [OrderController::class, 'getRegion']); //获取区域数据

        Route::post('/Amount/myAmount', [AmountController::class, 'myAmount']); //我的账户

        Route::post('/Amount/amountLog', [AmountController::class, 'amountLog']); //流水记录

        Route::post('/Amount/settleList', [AmountController::class, 'settleList']); //结算中心


        Route::post('/Amount/getSettleData', [AmountController::class, 'getSettleData']); //获取结算详情

        Route::post('/Amount/orderSettle', [AmountController::class, 'orderSettle']); //点击结算

        Route::any('/Amount/orderLeaseSettleExport', [AmountController::class, 'orderLeaseSettleExport']); //结算中心导出

        //商品管理
        Route::post('/Goods/getGoodsAll', [GoodsController::class, 'getGoodsList']); //商品列表
        Route::get('/Goods/getGoodsInfo', [GoodsController::class, 'getGoodsInfo']); //商品详情
        Route::get('/Goods/getCategory', [GoodsController::class, 'getCategory']); //获取商户一级品类
        Route::get('/Goods/getSecondCategory', [GoodsController::class, 'getSecondCategory']); //获取商户二级品类
        Route::get('/Goods/goodsShare', [GoodsController::class, 'goodsShare']); //商品分享
        Route::get('/Goods/userShare', [GoodsController::class, 'userShare']); //个人分享

        //提现
        Route::post('/Withdrawal/withdrawalList', [WithdrawalController::class, 'withdrawalList']); //提现记录
        Route::post('/Withdrawal/withdrawalApply', [WithdrawalController::class, 'withdrawalApply']); //申请提现
        Route::get('/Withdrawal/withdrawalInfo', [WithdrawalController::class, 'withdrawalInfo']); //提现信息
        Route::get('/Withdrawal/getPayeeInfo', [WithdrawalController::class, 'getPayeeInfo']); //获取收款账户信息

        //权限
        Route::post('/Auth/getAuthRule', [AuthController::class, 'getAuthRule']); //获取用户菜单权限
        Route::post('/Auth/editPwd', [AuthController::class, 'editPwd']); //修改密码

        Route::any('/Order/orderListSaleExport', [\App\Http\Controllers\Sale\OrderExportController::class, 'orderListSaleExport']); //修改密码


    });

});

